<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
use App\Http\Controllers\Api\IndexController;
use App\Http\Controllers\Api\LoginController;
use App\Http\Controllers\Api\OrderController;
use App\Http\Controllers\Api\WechatController;

Route::group(['namespace'=>'Api'],function(){
    Route::post('wxLogin',[LoginController::class,'wxLogin'])->name('wxLogin');
    Route::post('getPoster',[IndexController::class,'getPoster'])->name('getPoster');
    Route::post('getAdvert',[IndexController::class,'getAdvert'])->name('getAdvert');
    Route::post('getNotice',[IndexController::class,'getNotice'])->name('getNotice');
    Route::post('getPrice',[IndexController::class,'getPrice'])->name('getPrice');
    Route::any('payNotify',[WechatController::class,'payNotify'])->name('payNotify');
    Route::any('refundNotify',[WechatController::class,'refundNotify'])->name('refundNotify');
    Route::post('sendDelivery',[OrderController::class,'sendDelivery'])->name('pay');

});
Route::group(['namespace'=>'Api','middleware'=>'apiAuth'],function(){
    Route::post('getOrder',[OrderController::class,'getOrder'])->name('getOrder');
    Route::post('createOrder',[OrderController::class,'createOrder'])->name('createOrder');
    Route::post('pay',[OrderController::class,'payOrder'])->name('pay');
    Route::post('detail',[OrderController::class,'detail'])->name('detail');
    Route::post('cancelOrder',[OrderController::class,'cancelOrder'])->name('cancelOrder');

});
